import axios from "../../requery/index";
//当天故障次数
export function numberFaultsThatDay(params) {
    return axios({
        url: "/open/biz/countRecords",
        method: "get",
        datType: "JSON",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
//当天稼动率
export function getNightRecordBeatChart(data) {
    return axios({
        url: "/open/biz/getUtilizationRate",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}


//故障信息栏

export function getRecordExceptList(data) {
    return axios({
        url: "/open/biz/getRecordExceptList",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

//查看方案

export function getPlanList(data) {
    console.log(data);
    return axios({
        url: `/biz/mes-except/getPlansByExceptId`,
        method: "post",
        data,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}


//导航栏

export function searchAssemblyList({ equipmentId }) {
    return axios({
        url: `/open/biz/searchAssemblyList/${equipmentId}`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}


//设备状态


export function countStatusTime() {
    return axios({
        url: `/open/biz/countStatusTime`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
// 总常量
export function getTrendsRecordCapacityCount() {
    return axios({
        url: `/open/biz/getTrendsRecordCapacityCount`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

// 当天总常量

export function getTodayCapacityTotal() {
    return axios({
        url: `/open/biz/sumTodayTrendsRecordCapacity`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

//获取早班产能折线图
export function getCapacityRecord() {
    return axios({
        url: `/open/biz/getTrendsRecordCapacity`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}



//获取早班节能图
export function getBeatRecord() {
    return axios({
        url: `/open/biz/getTrendsRecordBeatChart`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}




export function maintenanceWork({ workpieceId }) {
    return axios({
        url: `/biz/mesWorkpiece/maintenanceWork/${workpieceId}`,
        method: "put",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}


export function maintenanceCountdown() {
    return axios({
        url: `/open/biz/maintenanceCountdown`,
        method: "get",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

export function equipmentAnalysis() {
    return axios({
        url: `/open/biz/equipmentAnalysis`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}

//更新未处理的故障

export function updateRecordStatus(data) {
    return axios({
        url: `/biz/mesRecordExcept/updateRecordStatus`,
        method: "put",
        data,
        headers: {
            "Content-Type": "application/json"
        }
    })
}

export function mainTenDownnceCountdown(data) {
    return axios({
        url: `/open/biz/maintenanceCountdown`,
        method: "get",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}
// 

export function CheckToWorkApi(data) {
    return axios({
        url: `/open/clock/checkToWork`,
        method: "post",
        data,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}




export function getNowWorkforces(){
    return axios({
        url: `/open/biz/getNowWorkforces`,
        method: "get",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    })
}